package com.vhall.component.framework.oss.client.impl.huawei;

import com.vhall.component.framework.common.exception.ErrorCode;
import com.vhall.component.framework.common.exception.GlobalErrorCode;
import com.vhall.component.framework.oss.client.OssCodeMapping;
import com.vhall.component.framework.oss.client.OssErrorCode;

/**
 * @author jingwen.li
 * @date 2023/2/22
 */
public class HuaweiObsCodeMapping implements OssCodeMapping {
    @Override
    public ErrorCode apply(String s) {
        switch (s) {
            case "OK":
                return GlobalErrorCode.SUCCESS;
            case "MissingAccessKeyId":
                return OssErrorCode.EXCEPTION;
            case "SignatureDoesNotMatch":
                return OssErrorCode.SIGN_ERROR;
            default:
                return OssErrorCode.UNKNOWN;
        }
    }
}
